var dates = new Date();
var dateJson = dates.toJSON();
var date = dateJson.match(/[1-2][0-9][0-9][0-9]-[0-1]{0,1}[0-9]-[0-3]{0,1}[0-9]/);
var time = dateJson.match(/\d{2}:\d{2}:\d{2}/);
alert(date[0] + " " + time[0]);
